:root {
  --second: hsl(227, 100%, 50%);
  --second-light: hsl(227, 77%, 57%);
  --second-lighter: hsl(227, 95%, 77%);
  --second-lightest: hsl(227, 44%, 88%);
  --accent: hsl(48, 100%, 52%);
  --accent-light: hsl(48, 100%, 63%);
  --accent-lighter: hsl(48, 100%, 82%);
}

html {
  font-size: 100%;
  min-width: 500px; /* min popup width for Chrome */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* General */

body {
  margin: 0;
  padding: 0;
}

body,
p,
form,
label,
span,
input,
button {
  font-size: 1rem;
  font-family: "Rubik", Arial, Helvetica, sans-serif;
}

p {
  margin: 0;
}

hr {
  margin: 17px auto;
  width: 75%;
  border: none;
  border-top: 3px solid var(--second-lightest);
}

#csv-reader-popup {
  border: 3px solid var(--second);
  padding: 12px;
}

h2 {
  font-size: 1.4rem;
  margin: 0;
  font-weight: 400;
}

form {
  margin-top: 22px;
}

/* Form */

#fields {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

form p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
  min-height: 29px;
}

form p#reset-container {
  margin-bottom: 0;
}

input {
  border: 2px solid var(--second-lighter);
  padding: 3px 7px;
  border-radius: 4px;
  width: 67px;
  transition: all 0.3s;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

input:hover {
  border: 2px solid var(--second) !important;
}

/* Checkboxes */

/* Base for label styling */
[type="checkbox"]:not(:checked),
[type="checkbox"]:checked {
  position: absolute;
  left: -9999px;
}
[type="checkbox"]:not(:checked) + label,
[type="checkbox"]:checked + label {
  position: relative;
  padding-right: 25px;
  width: 100%;
  cursor: pointer;
}
/* checkbox aspect */
[type="checkbox"]:not(:checked) + label:before,
[type="checkbox"]:checked + label:before {
  content: "";
  position: absolute;
  right: 0;
  top: -2px;
  width: 23px;
  height: 23px;
  border: 2px solid var(--second-lighter);
  background: white;
  border-radius: 4px;
  transition: all 0.3s;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* checked mark aspect */
[type="checkbox"]:not(:checked) + label:after,
[type="checkbox"]:checked + label:after {
  content: "\2713\0020";
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 1.1rem;
  line-height: 0.8;
  transition: all 0.3s;
  font-family: "Rubik";
}
/* checked mark aspect changes */
[type="checkbox"]:not(:checked) + label:after {
  opacity: 0;
  transform: scale(0);
}
[type="checkbox"]:checked + label:after {
  opacity: 1;
  transform: scale(1);
}
/* disabled checkbox */
[type="checkbox"]:disabled:not(:checked) + label:before,
[type="checkbox"]:disabled:checked + label:before {
  box-shadow: none;
  border-color: #bbb;
  background-color: #ddd;
}
[type="checkbox"]:disabled:checked + label:after {
  color: #999;
}
[type="checkbox"]:disabled + label {
  color: #aaa;
}
/* accessibility */
[type="checkbox"]:checked:focus + label:before,
[type="checkbox"]:not(:checked):focus + label:before {
  box-shadow: 0 0 0 2px var(--second-lighter);
}
/* hover style just for information */
label:hover:before {
  border: 2px solid var(--second) !important;
}

/* Buttons */

#buttons {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  grid-gap: 15px;
  gap: 15px;
}

button {
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  border: none;
  border-radius: 3px;
  text-align: center;
  background: var(--accent-light);
  padding: 9px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

button#convert {
  background: var(--accent);
}

button#color-code {
  background: linear-gradient(#fff5, #fff5),
    linear-gradient(
      45deg,
      hsl(calc(40 * 0), 85%, 60%),
      hsl(calc(40 * 1), 85%, 60%),
      hsl(calc(40 * 2), 85%, 60%),
      hsl(calc(40 * 3), 85%, 60%),
      hsl(calc(40 * 4), 85%, 60%),
      hsl(calc(40 * 5), 85%, 60%),
      hsl(calc(40 * 6), 85%, 60%),
      hsl(calc(40 * 7), 85%, 60%),
      hsl(calc(40 * 8), 85%, 60%)
    );
}

button#reset {
  padding-left: 25px;
  padding-right: 25px;
}

button:not(:disabled):hover,
button#convert:hover,
button#color-code:hover {
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  opacity: 0.6;
}

button:disabled {
  background-color: #d3d3d3;
  color: #aaa;
  cursor: not-allowed;
}

button svg {
  width: 1.6rem;
  height: 1.6rem;
  stroke-width: 1.5;
  stroke: var(--second);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.3s;
  margin-right: 7px;
}

button:disabled svg {
  stroke: #aaa;
}

button span,
button svg {
  pointer-events: none;
}

/* Error message handling */

.hidden {
  display: none !important;
}

#error-content {
  border: 3px solid var(--second);
  padding: 12px; 
}

#error-content p {
  margin-bottom: 7px;
}